<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=420, initial-scale=1.0">
    <title>游戏攻略日程</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, #e0f7fa, #f9fbe7);
            padding: 20px;
            display: flex;
            justify-content: center;
            min-height: 100vh;
        }
        
        .app-container {
            width: 420px;
        }
        
        .app-title {
            text-align: center;
            color: #0277bd;
            font-size: 24px;
            margin-bottom: 20px;
            font-weight: 600;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        }
        
        .day-card {
            background: white;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
            margin-bottom: 12px;
            overflow: hidden;
            transition: transform 0.2s;
        }
        
        .day-header {
            background: linear-gradient(120deg, #4db6ac, #81c784);
            color: white;
            padding: 6px 8px;
            font-size: 18px;
            font-weight: 600;
            display: flex;
            align-items: center;
        }
        
        .day-header::before {
            content: "📅";
            margin-right: 8px;
            font-size: 20px;
        }
        
        .time-section {
            padding: 6px 10px;
        }
        
        .time-header {
            display: flex;
            align-items: center;
            margin-bottom: 4px;
            color: #0288d1;
            font-weight: 600;
            font-size: 16px;
        }
        
        .time-icon {
            margin-right: 8px;
            font-size: 18px;
        }
        
        .event-list {
            margin-left: 26px;
        }
        
        .event-item {
            margin-bottom: 4px;
            position: relative;
        }
        
        .event-item::before {
            content: "- ";
            position: absolute;
            left: -12px;
            color: #4fc3f7;
            font-weight: bold;
        }
        
        .event-title {
            font-size: 15px;
            color: #263238;
            line-height: 1.4;
        }
        
        .event-footnote {
            font-size: 13px;
            color: #546e7a;
            margin-top: 4px;
            font-style: italic;
        }
        
        .divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, #e1f5fe, transparent);
            margin: 12px 0;
        }
        
        .empty-section {
            color: #90a4ae;
            font-style: italic;
            text-align: center;
            padding: 8px 0;
            font-size: 14px;
        }
    </style>
</head>
<body>
    <div id="app" class="app-container">
        <div v-for="(day, index) in scheduleData" :key="index" class="day-card">
            <div class="day-header">{{ day.date }}</div>
            
            <!-- 白天时段 -->
            <div v-if="day.events.day.length > 0" class="time-section">
                <div class="time-header">
                    <span class="time-icon">☀️</span>
                    <span>白天</span>
                </div>
                <div class="event-list">
                    <div v-for="(event, eventIndex) in day.events.day" :key="'day-'+eventIndex" class="event-item">
                        <div class="event-title">{{ event.title }}</div>
                        <div v-if="event.footnote" class="event-footnote">{{ event.footnote }}</div>
                    </div>
                </div>
            </div>
            
            
            <!-- 傍晚时段 -->
            <div v-if="day.events.evening.length > 0" class="time-section">
                <div class="time-header">
                    <span class="time-icon">🌅</span>
                    <span>傍晚</span>
                </div>
                <div class="event-list">
                    <div v-for="(event, eventIndex) in day.events.evening" :key="'evening-'+eventIndex" class="event-item">
                        <div class="event-title">{{ event.title }}</div>
                        <div v-if="event.footnote" class="event-footnote">{{ event.footnote }}</div>
                    </div>
                </div>
            </div>
            
            
            <!-- 夜晚时段 -->
            <div v-if="day.events.night.length > 0" class="time-section">
                <div class="time-header">
                    <span class="time-icon">🌙</span>
                    <span>夜晚</span>
                </div>
                <div class="event-list">
                    <div v-for="(event, eventIndex) in day.events.night" :key="'night-'+eventIndex" class="event-item">
                        <div class="event-title">{{ event.title }}</div>
                        <div v-if="event.footnote" class="event-footnote">{{ event.footnote }}</div>
                    </div>
                </div>
            </div>
            
        </div>
        <div style="text-align: center; color: darkgray;"> 第 {{ cur }}/{{ total }} 页</div>
    </div>

    <script>

        // 保存Vue实例引用
        window.vueApp = new Vue({
            el: '#app',
            data: {
                scheduleData: [],
                cur: 1,
                total: 2
            },
            methods: {
                setData(cur,total,data) {
					window.isScriptDone = false;
                    this.scheduleData = data;
                    this.cur = cur;
                    this.total = total;
                    setTimeout(()=>{window.isScriptDone = true;},300);
                }
            }
        });
        
        
        
        // 暴露给Puppeteer调用的方法
        window.SetData = function(cur,total,data) {
            window.vueApp.setData(cur,total,data);
        };
        window.SetData(1,11,[
      {
        "date": "7月30日",
        "events": {
          "day": [],
          "evening": [],
          "night": [
            {
              "title": "回到房间，睡觉",
              "footnote": null
            }
          ]
        }
      },
      {
        "date": "7月31日",
        "events": {
          "day": [
            {
              "title": "前往河滩，和田沼对话。",
              "footnote": null
            }
          ],
          "evening": [],
          "night": [
            {
              "title": "调查窗户，和犬之会对话",
              "footnote": null
            }
          ]
        }
      },
      {
        "date": "8月1日",
        "events": {
          "day": [
            {
              "title": "出门",
              "footnote": null
            },
            {
              "title": "前往每个地方探索",
              "footnote": "熟悉各个地方的地图"
            },
            {
              "title": "前往厨房，和塔子对话，接取委托",
              "footnote": null
            },
            {
              "title": "前往大门修理门框",
              "footnote": null
            },
            {
              "title": "前往厨房，和塔子对话，完成委托",
              "footnote": null
            }
          ],
          "evening": [
            {
              "title": "前往住宅区（七辻屋方向），和猫咪老师对话，接取委托",
              "footnote": null
            },
            {
              "title": "前往七辻屋，解锁商店功能",
              "footnote": null
            },
            {
              "title": "购买6个三色团子，和1个豆沙包（不要提交委托）",
              "footnote": null
            },
            {
              "title": "前往河滩，找到一目和牛面，对话接取委托",
              "footnote": null
            },
            {
              "title": "前往上学路->路边->古内高中，分别和任务人物对话",
              "footnote": null
            },
            {
              "title": "在古内高中门口找到犬之会的扇子",
              "footnote": null
            },
            {
              "title": "回到河滩，完成任务",
              "footnote": null
            }
          ],
          "night": [
            {
              "title": "前往厨房，给塔子和滋各自送一个三色团子",
              "footnote": null
            },
            {
              "title": "回到房间，睡觉",
              "footnote": null
            }
          ]
        }
      }
   ]);
        
    </script>
</body>
</html>
